<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:br="http://bree.owenrb.com/functions">
<body>
	<ui:composition>
		<p:dialog header="Returns Withdrawal Detail" widgetVar="returnsDialog"
			modal="true" showEffect="fade" hideEffect="fade" resizable="false">
			<p:outputPanel id="returnsDetail" style="text-align:center;">
				<p:panelGrid
					rendered="#{not empty dtReserveBalanceLazyView.selectedItem}"
					columnClasses="label,value">
					<f:facet name="header">
						<p:row>
							<p:column>Name</p:column>
							<p:column>Brand</p:column>
							<p:column>Part Number</p:column>
							<p:column>Quantity</p:column>
							<p:column>Unit</p:column>
						</p:row>
					</f:facet>
					<p:row>
						<p:column>#{dtReserveBalanceLazyView.selectedItem.partUnit.shortName}</p:column>
						<p:column>#{dtReserveBalanceLazyView.selectedItem.partUnit.shortBrand}</p:column>
						<p:column>#{dtReserveBalanceLazyView.selectedItem.partUnit.part}</p:column>
						<p:column>
							<p:spinner value="#{dtReserveBalanceLazyView.quantity}" min="1" max="#{dtReserveBalanceLazyView.selectedItem.totalBalance - br:nvl(quantityMap[dtReserveBalanceLazyView.selectedItem.warehousePartUnitId],0)}">
								<f:convertNumber integerOnly="true"/> 
							</p:spinner>
						</p:column>
						<p:column>#{dtReserveBalanceLazyView.selectedItem.partUnit.shortUnit}</p:column>
					</p:row>

				</p:panelGrid>

				<br />
				<p:commandButton value="Reserve" ajax="true"
					update="#{reserveCommandUpdate}"
					oncomplete="if(!args.validationFailed) PF('returnsDialog').hide();"
					action="#{dtReserveBalanceLazyView.reserve}" />

			</p:outputPanel>
		</p:dialog>
	</ui:composition>
</body>
</html>